module Model
  class User < ActiveRecord::Base
    has_many :threads
    has_many :replies
  end
  class Thread < ActiveRecord::Base
    has_many :replies
    belongs_to :user
  end
  class Reply < ActiveRecord::Base
    belongs_to :thread
    has_many :replies
    belongs_to :reply, :foreign_key => "parent_id"
    belongs_to :user
    acts_as_tree
  end
end